/*
 * Copyright 2018 Zhongan.com All right reserved. This software is the
 * confidential and proprietary information of Zhongan.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with Zhongan.com.
 */

package com.zhongan.cloud.gateway.filter.previous;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 类UrlRouteEnum的实现描述：请求网关URL规则路由枚举类
 *
 * @author chenyao 2016年10月18日 下午10:40:21
 */
@Getter
@AllArgsConstructor
public enum UrlRouteEnum {
    /**
     * 外网和内网都能访问此接口
     */
    INTERNET("internet", "外网和内网都能访问此接口"),
    /**
     * 只有内网能访问此接口
     */
    INTRANET("intranet", "只有内网能访问此接口"),
    /**
     * 需要使用"gateway/api"进行访问
     */
    API("api", "需要使用\"gateway/api\"进行访问");

    private String value;
    private String name;

    public static UrlRouteEnum getEnumByValue(String value) {
        if (value == null) {
            return null;
        }
        for (UrlRouteEnum item : UrlRouteEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }
}
